#include    "questionentry.h"
#include    <cstdlib>

QuestionEntry::QuestionEntry(): question_number(-1),question("")
{
    this->answers.clear();
}
QuestionEntry::~QuestionEntry()
{
    this->answers.clear();
    this->question_number = -1;
}

bool QuestionEntry::setQuestionNumber(int number)
{
    this->question_number = number;
    return true;
}

bool QuestionEntry::setQuestionNumber(const std::string& numberString)
{
    this->question_number = atoi(numberString.c_str());
    return true;
}

bool QuestionEntry::setQuestionValue(const std::string& question)
{
    this->question = question;
    return true;
}

bool QuestionEntry::setAnswer(const std::string& answer)
{
    this->answers.push_back(answer);
    return true;
}

void QuestionEntry::cleanAnswers()
{
    this->answers.clear();
}

int QuestionEntry::getQuestionNumber() const
{
    return this->question_number;
}

const std::string& QuestionEntry::getQuestionValue() const
{
    return this->question;
}

const std::vector<std::string>& QuestionEntry::getAnswers() const
{
    return this->answers;
}
